<?php
$this->pageTitle = t('PAGE_TITLE', 'gallery') . '-' . $album->name;
$this->breadcrumbs = array('Gallery' => url('gallery/index'), $album->name);
$themeUrl = Yii::app()->theme->baseUrl;
?>
<script type="text/javascript" src="<?php echo $themeUrl; ?>/js/pretty-photo/jquery.pretty.photo.js"></script> 
<link type="text/css" href="<?php echo $themeUrl; ?>/js/pretty-photo/style.css" rel="stylesheet" media="screen" />

<div class="component_heading">
    <h1><?php echo CHtml::encode(t('PAGE_TITLE', 'gallery') . ' > ' . $album->name) ?></h1>
</div>
<div class="component_content">
<?php
$this->widget('zii.widgets.CListView', array(
    'dataProvider' => $dataProvider,
    'itemView' => '_item',
	'itemsTagName' => 'ul',
	'itemsCssClass' => 'gallery',
    'template' => '{items} {pager}'
));
?>
<br clear="all" />
</div>
<script type="text/javascript">
    $(document).ready(function() {
	$("a[rel='slide[photos]']").prettyPhoto({
	    animation_speed: 'normal',
	    slideshow: 8000,
	    autoplay_slideshow: true
	});
	$("#datepicker").datepicker({
	    onSelect: function(dateText, inst) {
		//create custom event to handle datepicker select
		window.location.href = "<?php echo url(Yii::app()->controller->id . "/photo/{$album->id}-{$alias}"); ?>" + "?date=" + dateText;
	    }
	});
    });
</script>
